#coding:utf8
SNR = range(-10,31)

a = [0.251, 0.252, 0.302, 0.313, 0.403,
 0.422, 0.429, 0.473, 0.501, 0.532,
 0.583, 0.595, 0.651, 0.691, 0.717,
 0.775, 0.808, 0.846, 0.878, 0.932,
 0.941, 0.939, 0.979, 0.981, 0.983,
 0.991, 0.994, 0.988, 0.996, 0.979,
 0.992, 0.999, 0.999, 0.993, 0.992,
 0.993, 0.992, 0.996, 0.999, 0.998, 0.999]


b = [0.20, 0.21, 0.212, 0.224, 0.235,
0.252, 0.263, 0.277, 0.301, 0.32,
0.35, 0.37, 0.398, 0.427, 0.461,
0.504, 0.546, 0.595, 0.633, 0.689,
0.72, 0.76, 0.805, 0.84, 0.89,
0.925, 0.945, 0.96, 0.98, 0.9885521660770309, 0.9876176490220947, 0.99876510246312, 0.9957279220345772, 0.9980308390628129, 0.9990321073359589, 0.998998731726854, 1.0, 1.0, 1.0, 1.0, 1]

c = [0.1, 0.0991, 0.108, 0.115, 0.12,
0.13, 0.136, 0.143, 0.156, 0.166,
0.176, 0.196, 0.206, 0.229, 0.248,
0.271, 0.3, 0.325, 0.357, 0.38,
0.42, 0.478, 0.51, 0.56, 0.60,
0.66, 0.71, 0.72, 0.76, 0.78,
0.82, 0.85, 0.88, 0.896, 0.9206121086709832, 0.936982177424738, 0.9458520793004472, 0.9549429277084307, 0.9525145183899606, 0.9679467325278687, 0.973]


import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['simhei'] #用来正常显示中文标签

plt.rcParams['axes.unicode_minus']=False #用来正常显示负号

a = [0.95*(1-x) for x in a]
b = [0.975*(1-x) for x in b]
c = [0.975*(1-x) for x in c]

line_lrs, = plt.plot(SNR,a, 'rv-', label='QPSK')
line_mlp, = plt.plot(SNR,b, 'go-', label='8PSK')
line_16psk, = plt.plot(SNR,c, 'bs-', label='16PSK')
plt.legend([line_lrs,line_mlp, line_16psk],['QPSK', '8PSK', '16PSK'])
plt.xlabel(u"信噪比(dB)", fontsize=16)
plt.ylabel(u"误符号率", fontsize=16)
plt.ylim(0,1)
#plt.show()

plt.savefig('CP4CNN.png')
